package isquirrel.beans;

import java.text.DecimalFormat;


public class Friend implements Comparable{

	
	private String name;
	private Long fbID;
	private Long userID;
	private String pic;
	private int likes;
	private double profilematch;
	
	public Friend(String name,Long fbID, Long userID, String pic, int likes, double profilematch){
		this.name = name;
		this.fbID = fbID;
		this.userID = userID;
		this.pic = pic;
		this.likes = likes;
		this.profilematch = profilematch;
	}

	public int getLikes() {
		return likes;
	}
	
	public double getProfileMatch(){
		return profilematch;
	}
	
	public String getProfileMatch_formatted(){
        DecimalFormat df = new DecimalFormat("#0.00");
		return df.format(profilematch);
	}
	
	public void setProfileMatch(double pm){
		profilematch = pm;
	}

	public void setLikes(int likes) {
		this.likes = likes;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getFbID() {
		return fbID;
	}

	public void setFbID(Long fbID) {
		this.fbID = fbID;
	}

	public Long getUserID() {
		return userID;
	}

	public void setUserID(Long userID) {
		this.userID = userID;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	@Override
	public int compareTo(Object o) {
		if (this.profilematch > ((Friend) o).getProfileMatch()) return -1;
		else if (this.profilematch == ((Friend) o).getProfileMatch()) return 0; 
		else return 1;
	}
}
